package dao

import (
	"time"
)

// 这是 SysOperationRecord 的全局公开dao对象
var SysOperationRecordDao = sysOperationRecordDao{}

// 这是 sys_operation_record表 的实体类
type SysOperationRecord struct {
	Id           int       `json:"id" form:"id" binding:"id"`
	CreatedAt    time.Time `json:"created_at" form:"created_at" binding:"created_at"`
	UpdatedAt    time.Time `json:"updated_at" form:"updated_at" binding:"updated_at"`
	DeletedAt    time.Time `json:"deleted_at" form:"deleted_at" binding:"deleted_at"`
	Ip           string    `json:"ip" form:"ip" binding:"ip"`                                  // 请求ip
	Method       string    `json:"method" form:"method" binding:"method"`                      // 请求方法
	Path         string    `json:"path" form:"path" binding:"path"`                            // 请求路径
	Status       int       `json:"status" form:"status" binding:"status"`                      // 请求状态
	Latency      int64       `json:"latency" form:"latency" binding:"latency"`                   // 延迟
	Agent        string    `json:"agent" form:"agent" binding:"agent"`                         // 代理
	ErrorMessage string    `json:"error_message" form:"error_message" binding:"error_message"` // 错误信息
	Body         string    `json:"body" form:"body" binding:"body"`                            // 请求Body
	Resp         string    `json:"resp" form:"resp" binding:"resp"`                            // 响应Body
	UserId       int       `json:"user_id" form:"user_id" binding:"user_id"`                   // 用户id
	SysUser
}

// 注意:这是 SysOperationRecord 的私有dao对象
type sysOperationRecordDao struct {
	Obj         SysOperationRecord
	Insert      func(arg SysOperationRecord) int //插入一条记录
	Update      func(arg SysOperationRecord) int //更新一条记录
	Delete      func(arg SysOperationRecord) int //删除一条记录
	Select      func(id int) SysOperationRecord  `arg:"id"` //获取一条记录
	DeleteByIds func(ids []int) int              `arg:"ids"`
	List 		func(arg SysOperationRecordSearch)[]map[string]string
}



